package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.DeleteteajlServiceljc;
import com.zr.serviceImpl.DeleteteajlServiceImplljc;

public class DeleteteajlControllerljc extends HttpServlet{
	//教师删除申请记录
	DeleteteajlServiceljc d = new DeleteteajlServiceImplljc();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String ck[] = req.getParameterValues("id[]");
		PrintWriter pw = resp.getWriter();
		for (int i = 0; i < ck.length; i++) {
			int i1 = Integer.parseInt(ck[i]);
			boolean flag = d.deleteteaJLById(i1);
			if(flag){
				pw.write("1");
			}else{
				pw.write("0");
			}
		}
		pw.flush();
		pw.close();
	}
}
